﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class yiwutong_web_categories : System.Web.UI.Page
{
    public string rehospitalid = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["hospitalid"] != null && Request.QueryString["hospitalid"] != "")
            {
                rehospitalid = Request.QueryString["hospitalid"].ToString();
                lblHospitalID.Text = Request.QueryString["hospitalid"].ToString();
                lblHospitalName.Text = GetHospitalName(Request.QueryString["hospitalid"].ToString());
            }
            else
            {
                Response.Redirect("index.html");
                
            }
        }
    }

    #region 根据数字ID返回医院名字
    public string GetHospitalName(string id)
    {
        string hospitalname = "";

        switch (id)
        {
            case "h1":
                hospitalname = "广西医科大学第一附属医院";
                break;
            case "h2":
                hospitalname = "广西壮族自治区人民医院";
                break;
            case "h3":
                hospitalname = "广西医科大学第二附属医院";
                break;
            case "h4":
                hospitalname = "广西中医学院第一附属医院";
                break;
            default:
                hospitalname = "未知医院名称";
                break;
        }

        return hospitalname;
    }
    #endregion

    #region 全为数字
    public bool isnumber(string s)
    {
        int Flag = 0;
        char[] str = s.ToCharArray();
        for (int i = 0; i < str.Length; i++)
        {
            if (Char.IsNumber(str[i]))
            {
                Flag++;
            }
            else
            {
                Flag = -1;
                break;
            }
        }
        if (Flag > 0)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    #endregion
}
